package validateUserModule.component;

import java.sql.Connection;
import java.util.List;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IParameterContext;
import edu.ccut.saturn.component.SaturnData;
import edu.ccut.saturn.operation.Operation;
import edu.ccut.saturn.workflow.common.Constants;
import edu.ccut.saturn.workflow.common.WorkFlowTools;

public class GetParticipants extends DefaultComponent {
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		/*String bussinessType = (String)parameterContext.getParameterValue(2);
		String userSerialNo = (String)parameterContext.getParameterValue(1);
		boolean isValidUser = false;
		Connection conn = parameterContext.getConnection();
		String sql = "select * from business where business_type = "+ bussinessType;
		List<SaturnData> participantDataList = Operation.dataBase().queryBySQL("http://edu.ccut.saturn.workflow/validateUserModule/Data::business",sql, conn);
		for(int i=0;i<participantDataList.size();i++){
			SaturnData participant = participantDataList.get(i);
			
			List<SaturnData> userDataList =WorkFlowTools.getUserDataList(participant.get("user_type")+"",participant.get("user_id")+"",conn);
			
			for(int j=0;j<userDataList.size();j++){
				SaturnData user = userDataList.get(j);
				if(userSerialNo.equals(user.get("id")+"")){
					isValidUser = true;
					break;
				}
			}
			if(isValidUser){
				break;
			}
		}
		parameterContext.setParameter(3, isValidUser);*/
	}
}